/*
 * @Author: szx
 * @Date: 2022-07-12 12:49:18
 * @LastEditTime: 2022-07-12 12:56:23
 * @Description:
 * @FilePath: \leetcode\1200-1299\1217\1217.js
 */
/**
 * @param {number[]} position
 * @return {number}
 */
var minCostToMoveChips = function (position) {
    let ji = 0,
        ou = 0;
    for (let pos of position) {
        if (pos & 1) ji++;
        else ou++;
    }
    return Math.min(ji, ou);
};
